﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/static/js/laydate5.3.1/theme/default/laydate.css" type="text/css" media="all"/>
    <link rel="stylesheet" href="/static/js/layui/css/layui.css" type="text/css" media="all"/>
    <style>
        .layui-table-cell{
            line-height: 20px !important;
            vertical-align: middle;
            height: auto;
            overflow: visible;
            text-overflow: inherit;
            white-space: normal;
        }
        .demo-footer a{padding: 0 5px; color: #01AAED;}
        .table-header-fixed {
            top: 0;
            position: fixed;
            z-index: 999;
        }
        .table-height {
            padding-top: 27%;
        }
        .layui-form-item{
            clear: both;
        }
        .layui-table {
            width: 100%;
            margin: 0px 0;
            background-color: #fff;
            color: #666;
        }
        .layui-table-view {
            margin: 0px 0;
        }
    </style>
</head>
<body>
<div class="layui-form">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">日期范围</label>
            <div class="layui-inline" id="test6">
                <div class="layui-input-inline">
                    <input type="text" autocomplete="off" id="startDate" class="layui-input" placeholder="开始日期">
                </div>
                <div class="layui-form-mid">-</div>
                <div class="layui-input-inline">
                    <input type="text" autocomplete="off" id="endDate" class="layui-input" placeholder="结束日期">
                </div>
            </div>
            <button class="layui-btn layui-btn-normal" id="exports">导出</button>
            <button class="layui-btn layui-btn-warm" id="select">查询</button>
        </div>
    </div>
</div>
<table class="layui-table" id="test" >
</table>

<script src="/static/js/laydate5.3.1/laydate.js" charset="utf-8" type="text/javascript"></script>
<script src="/static/js/jquery-3.6.0.min.js" charset="utf-8" type="text/javascript"></script>
<script src="/static/js/layui/layui.js" charset="utf-8" type="text/javascript"></script>
<script>
    layui.use(["table","layer"], function(){
        // 加载提示
        var loadingMsg = layer.msg('数据请求中', {icon: 16,scrollbar: false,time: 0});
        var table = layui.table;
        var level = ${level!''};
        var localCode = ${localCode!''}
        var date = new Date();
        var month = date.getMonth()+1;
        var day = date.getDate();
        var year = date.getFullYear();
        month = (month.toString().length == 1) ? ("0"+month) : month;
        day = (day.toString().length == 1) ? ("0"+day) : day;
        var startDate = year+'-01-01';
        var endDate = year+'-'+month+'-'+day;
        var tableIns = table.render({
            elem: '#test',
            method:'post',
            url: '/azbj/statisticalreports/info/list',
            id:'tableId',
            even:true,
            height:'full-100',
            cols:[
                [
                    {colspan:70,align:'center',title:'刑满释放人员安置帮教工作统计表'}
                ],
                [
                    {colspan:70,align:'left',
                        title:'   统计期间：'
                    }
                ],
                [
                    {field:'childs',align:'center',rowspan:4,title:'项目',width:'120',unresize:true},
                    {align:'center',colspan:8,title:'工作机构及人员队伍情况',unresize:true},
                    {align:'center',colspan:17,title:'衔接情况',unresize:true},
                    {align:'center',colspan:25,title:'安置情况',unresize:true},
                    {align:'center',colspan:9,title:'社会救助及就业服务情况',unresize:true},
                    {align:'center',colspan:4,title:'帮教情况',unresize:true},
                    {align:'center',colspan:5,title:'帮教期内重新犯罪情况',unresize:true},
                    {field:'slrs',rowspan:4,title:'失联人员',unresize:true}
                ],
                [
                    {align:'center',colspan:2,title:'地市司法局',unresize:true},
                    {align:'center',colspan:2,title:'区县司法局',unresize:true},
                    {align:'center',colspan:2,title:'司法所',unresize:true},
                    {field:'sgrs',rowspan:3,title:'从事安置帮教的社会工作者',unresize:true},
                    {field:'zyzrs',rowspan:3,title:'从事安置帮教的社会志愿者',unresize:true},
                    {field:'xjzs',rowspan:3,title:'衔接人员总数',unresize:true},
                    {align:'center',colspan:7,title:'其中',unresize:true},
                    {field:'zdbj',rowspan:3,title:'重点帮教对象',unresize:true},
                    {field:'zdbjjsl',rowspan:3,title:'重点帮教对象接送率',unresize:true},
                    {align:'center',colspan:4,title:'其中',unresize:true},
                    {field:'ybbj',rowspan:3,title:'一般帮教对象',unresize:true},
                    {align:'center',colspan:2,title:'其中',unresize:true},
                    {field:'azzs',rowspan:3,title:'安置总人数',unresize:true},
                    {align:'center',colspan:9,title:'企业认证为安置基地',unresize:true},
                    {align:'center',colspan:6,title:'建设政府投入为主的过渡性安置基地',unresize:true},
                    {field:'azzrt',rowspan:3,title:'落实责任田',unresize:true},
                    {field:'azgxygw',rowspan:3,title:'公益性岗位安置',unresize:true},
                    {align:'center',colspan:2,title:'自主创业',unresize:true},
                    {align:'center',colspan:2,title:'从事个体经营',unresize:true},
                    {align:'center',colspan:2,title:'企业和经济实体吸纳就业',unresize:true},
                    {field:'qtazfs',rowspan:3,title:'其他安置方式',unresize:true},
                    {align:'center',colspan:3,title:'获得就业服务',unresize:true},
                    {align:'center',colspan:6,title:'获得社会救助',unresize:true},
                    {field:'bjzs',rowspan:3,title:'帮教总人数',unresize:true},
                    {align:'center',colspan:3,title:'其中',unresize:true},
                    {field:'cxfz',rowspan:3,title:'安置帮教人员五年内重新犯罪',unresize:true},
                    {align:'center',colspan:4,title:'其中',unresize:true}
                ],
                [
                    {field:'cjgs',rowspan:2,title:'工作机构',unresize:true},
                    {field:'cjgrs',rowspan:2,title:'工作人员',unresize:true},
                    {field:'ccjgs',rowspan:2,title:'工作机构',unresize:true},
                    {field:'ccjgrs',rowspan:2,title:'工作人员',unresize:true},
                    {field:'cccjgs',rowspan:2,title:'工作机构',unresize:true},
                    {field:'cccjgrs',rowspan:2,title:'工作人员',unresize:true},
                    {field:'jysf',rowspan:2,title:'监狱刑满释放人员',unresize:true},
                    {field:'ksssf',rowspan:2,title:'看守所刑满释放人员',unresize:true},
                    {field:'sqjzzr',rowspan:2,title:'解除社区矫正人员',unresize:true},
                    {field:'man',rowspan:2,title:'男性',unresize:true},
                    {field:'woman',rowspan:2,title:'女性',unresize:true},
                    {field:'ncj',rowspan:2,title:'农村籍',unresize:true},
                    {field:'sanwu',rowspan:2,title:'三无',unresize:true},
                    {field:'zdjczfjh',rowspan:2,title:'基层政府接回',unresize:true},
                    {field:'zdjssh',rowspan:2,title:'监所送回原籍',unresize:true},
                    {field:'zdsfsjjczzjh',rowspan:2,title:'司法所及基层组织接回',unresize:true},
                    {field:'galsgk',rowspan:2,title:'公安机关落实管控措施',unresize:true},
                    {field:'ybjczzjjsjh',rowspan:2,title:'基层组织及家属接回',unresize:true},
                    {field:'ryzf',rowspan:2,title:'人员自返',unresize:true},
                    {align:'center',colspan:2,title:'省(区、市)',unresize:true},
                    {align:'center',colspan:2,title:'地(市、州)',unresize:true},
                    {align:'center',colspan:2,title:'县(市、区)',unresize:true},
                    {align:'center',colspan:2,title:'乡镇(街道)',unresize:true},
                    {field:'azjdlsjmszc',rowspan:2,title:'落实减免税政策',unresize:true},
                    {align:'center',colspan:2,title:'省(区、市)',unresize:true},
                    {align:'center',colspan:2,title:'地(市、州)',unresize:true},
                    {align:'center',colspan:2,title:'县(市、区)',unresize:true},
                    {field:'zzcyrs',rowspan:2,title:'人数',unresize:true},
                    {field:'zzcylsjmszc',rowspan:2,title:'落实减免税政策',unresize:true},
                    {field:'gtjyrs',rowspan:2,title:'人数',unresize:true},
                    {field:'gtjylsjmszc',rowspan:2,title:'落实减免税政策',unresize:true},
                    {field:'qyxnrs',rowspan:2,title:'人数',unresize:true},
                    {field:'qyxnlsjmszc',rowspan:2,title:'落实减免税政策',unresize:true},
                    {field:'sydj',rowspan:2,title:'失业登记',unresize:true},
                    {field:'jnpx',rowspan:2,title:'技能培训',unresize:true},
                    {field:'jytj',rowspan:2,title:'推荐就业',unresize:true},
                    {field:'lszdshbz',rowspan:2,title:'落实最低生活保障',unresize:true},
                    {field:'lstkrygy',rowspan:2,title:'落实特困人员供养',unresize:true},
                    {field:'lsyljz',rowspan:2,title:'落实医疗救助',unresize:true},
                    {field:'lsjyjz',rowspan:2,title:'落实教育救助',unresize:true},
                    {field:'lszfjz',rowspan:2,title:'落实住房救助',unresize:true},
                    {field:'lslsjz',rowspan:2,title:'落实临时救助',unresize:true},
                    {field:'rdrt',rowspan:2,title:'入党入团',unresize:true},
                    {field:'drldzw',rowspan:2,title:'担任领导职务',unresize:true},
                    {field:'sdzjgbz',rowspan:2,title:'受党政机关表彰',unresize:true},
                    {field:'jyxmsf',rowspan:2,title:'监狱刑满释放',unresize:true},
                    {field:'kssxmsf',rowspan:2,title:'看守所刑满释放',unresize:true},
                    {field:'jcsqjz',rowspan:2,title:'解除社区矫正',unresize:true},
                    {field:'cxfma',rowspan:2,title:'重新犯命案',unresize:true}
                ],
                [
                    {field:'sqyjds',rowspan:1,title:'基地数',unresize:true},
                    {field:'sqyazry',rowspan:1,title:'安置人员',unresize:true},
                    {field:'dsqyjds',rowspan:1,title:'基地数',unresize:true},
                    {field:'dsqyazry',rowspan:1,title:'安置人员',unresize:true},
                    {field:'qxqyjds',rowspan:1,title:'基地数',unresize:true},
                    {field:'qxqyazry',rowspan:1,title:'安置人员',unresize:true},
                    {field:'jdqyjds',rowspan:1,title:'基地数',unresize:true},
                    {field:'jdqyazry',rowspan:1,title:'安置人员',unresize:true},
                    {field:'szfjds',rowspan:1,title:'基地数',unresize:true},
                    {field:'szfazrs',rowspan:1,title:'安置人员',unresize:true},
                    {field:'dszfjds',rowspan:1,title:'基地数',unresize:true},
                    {field:'dszfazrs',rowspan:1,title:'安置人员',unresize:true},
                    {field:'qxzfjds',rowspan:1,title:'基地数',unresize:true},
                    {field:'qxzfazrs',rowspan:1,title:'安置人员',unresize:true},
                ],
                [
                    {align:'center',colspan:1,title:'单位',width:'120',unresize:true},
                    {align:'center',colspan:1,title:'个',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'个',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'个',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'%',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'个',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'个',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'个',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'个',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'个',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'个',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'个',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                    {align:'center',colspan:1,title:'人',unresize:true},
                ]
            ],
            done: function(res, curr, count) {
                //处理统计期间日期显示问题
                $(".layui-table-header").find("tr").eq(1).find("th").find("div").text('   统计期间：'+$("#startDate").val()+' - '+$("#endDate").val());
                // 关闭提示层
                layer.close(loadingMsg);
                //处理复杂表头因为colspan=1而多出的列
                $(".layui-table-body").find("td").each(function (index, element) {
                    if ($(this).attr("data-field") >= 0) {
                        $(this).css("display", "none");
                    }
                });
                //处理单元格的宽度
                $(".layui-table-header").find("tr").eq(3).find("th").find("div").css("width", "15px");
                $(".layui-table-header").find("tr").eq(3).find("th").each(function (index, element) {
                    if (" layui-table-col-special" == $(this).attr("class")) {
                        if (index == 13) {
                            $(this).find("div").css("width","540px");
                        }else if (index == 14 || index == 22) {
                            $(this).find("div").css("width", "360px");
                        }else if (index == 6) {
                            $(this).find("div").css("width", "420px");
                        } else if (index == 9 || index == 26) {
                            $(this).find("div").css("width", "215px");
                        } else if (index == 21 || index == 24) {
                            $(this).find("div").css("width", "180px");
                        } else {
                            $(this).find("div").css("width", "120px");
                        }
                    }

                });
                $(".layui-table-header").find("tr").eq(4).find("th").find("div").css("width", "15px");
                $(".layui-table-header").find("tr").eq(4).find("th").each(function (index, element) {
                    if (" layui-table-col-special" == $(this).attr("class")) {
                        $(this).find("div").css("width","120px")
                    }
                });
                $(".layui-table-header").find("tr").eq(5).find("th").find("div").css("width", "15px");
                //设置单元格的边框
                $(".layui-table-header").find("tr").eq(1).find("th").eq(0).attr('style','border-right:none');
                if (localCode == '140000') {
                    $(".layui-table-header").find("tr").eq(2).find("th").eq(7).find("div").text("人户分离") ;
                }
                //处理角色不同，所看见的列也不同
                if (level == 7) {
                    //地市司法局
                    $(".layui-table-header").find("tr").eq(6).find("th").each(function (index, element) {
                        if (index >3 && index < 6) {
                            $(this).addClass("layui-hide");
                        }
                    });
                    $(".layui-table-header").find("tr").eq(4).find("th").each(function (index, element) {
                        if (index >3 && index < 6) {
                            $(this).addClass("layui-hide");
                        }
                    });
                    $(".layui-table-header").find("tr").eq(3).find("th").each(function (index, element) {
                        if (index == 2) {
                            $(this).addClass("layui-hide");
                        }
                    });
                    $(".layui-table-header").find("tr").eq(3).find("th").eq(0).find("div").text("区县司法局") ;
                    $(".layui-table-header").find("tr").eq(3).find("th").eq(1).find("div").text("司法所") ;
                    $(".layui-table-header").find("tr").eq(2).find("th").each(function (index, element) {
                        if (index== 1) {
                            $(this).attr("colspan",6)
                        }
                    });
                    $(".layui-table-header").find("tr").eq(1).find("th").each(function (index, element) {
                        if (index== 1) {
                            $(this).attr("colspan",68)
                        }
                    });
                    $(".layui-table-body").find("td").each(function (index, element) {
                        if ($(this).attr("data-field") == 'cccjgs' ||$(this).attr("data-field") == 'cccjgrs') {
                            $(this).css("display", "none");
                        }
                    });
                }else if (level == 8) {
                    //区县司法局
                    $(".layui-table-header").find("tr").eq(6).find("th").each(function (index, element) {
                        if (index >1 && index < 6) {
                            $(this).addClass("layui-hide");
                        }
                    });
                    $(".layui-table-header").find("tr").eq(4).find("th").each(function (index, element) {
                        if (index >1 && index < 6) {
                            $(this).addClass("layui-hide");
                        }
                    });
                    $(".layui-table-header").find("tr").eq(3).find("th").each(function (index, element) {
                        if (index== 1 || index == 2) {
                            $(this).addClass("layui-hide");
                        }
                    });
                    $(".layui-table-header").find("tr").eq(3).find("th").eq(0).find("div").text("司法所") ;
                    $(".layui-table-header").find("tr").eq(2).find("th").each(function (index, element) {
                        if (index== 1) {
                            $(this).attr("colspan",4)
                        }
                    });
                    $(".layui-table-header").find("tr").eq(1).find("th").each(function (index, element) {
                        if (index== 1) {
                            $(this).attr("colspan",66)
                        }
                    });
                    $(".layui-table-body").find("td").each(function (index, element) {
                        if ($(this).attr("data-field") == 'ccjgs' || $(this).attr("data-field") == 'ccjgrs' || $(this).attr("data-field") == 'cccjgs' ||$(this).attr("data-field") == 'cccjgrs') {
                            $(this).css("display", "none");
                        }
                    });
                }
                //处理复杂表头固定
                let headerTop = $('.layui-table-header').offset().top; //获取表格头到文档顶部的距离
                $(window).scroll(function () {
                    if ((headerTop - $(window).scrollTop()) < 0) { //超过了
                        $('.layui-table-header').addClass('table-header-fixed'); //添加样式，固定住表头
                        $('.layui-table-box').addClass('table-height');
                    } else { //没超过
                        $('.layui-table-header').removeClass('table-header-fixed'); //移除样式
                        $('.layui-table-box').removeClass('table-height'); //移除样式
                    }
                });
                //滚动body,header跟随滚动
                $('.layui-table-body').on('scroll', function(e) {
                    var leftPx = $(e.target).scrollLeft(); //获取表格body，滚动条距离左边的长度
                    var left = 'translateX(-' + leftPx + 'px)';
                    $('.layui-table-header .layui-table').css('transform', left); //设置表格header的内容反向(-)移动
                });
            }
        });
        laydate.render({
            elem:'#test6',
            range: ['#startDate', '#endDate'],
            done: function (value) {
                var value = value;
                var data = value.split(" - ");
                startDate = data[0];
                endDate = data[1];
            },
        });
        laydate.render({
            elem:'#startDate',
            value: year+'-01-01'
        });
        laydate.render({
            elem:'#endDate',
            value: new Date()
        });
        //表格重载
        function reloadTable() {
            // 加载提示
            var loadingMsg = layer.msg('数据请求中', {icon: 16,scrollbar: false,time: 0});
            table.reload('tableId', {
                url: '/azbj/statisticalreports/info/list',
                method: 'post',
                height: 'full-100',
                where:{
                    'startDate':startDate,
                    'endDate':endDate
                },
                done: function () {

                    laydate.render({
                        elem:'#startDate',
                        value: startDate
                    });
                    laydate.render({
                        elem:'#endDate',
                        value: endDate
                    });
                    laydate.render({
                        elem:'#test6',
                        range: ['#startDate', '#endDate'],
                        done: function (value) {
                            var value = value;
                            var data = value.split(" - ");
                            startDate = data[0];
                            endDate = data[1];
                        },
                    });
                    //处理统计时间展示
                    $(".layui-table-header").find("tr").eq(1).find("th").find("div").text('   统计期间：'+$("#startDate").val()+' - '+$("#endDate").val());
                    $(".layui-table-header").find("tr").eq(1).find("th").find("div").height("20px");
                    //处理复杂表头因为colspan=1而多出的列
                    $(".layui-table-body").find("td").each(function (index, element) {
                        if ($(this).attr("data-field") >= 0) {
                            $(this).css("display", "none");
                        }
                    });
                    //处理单元格的宽度
                    $(".layui-table-header").find("tr").eq(3).find("th").find("div").css("width", "15px");
                    $(".layui-table-header").find("tr").eq(3).find("th").each(function (index, element) {
                        if (" layui-table-col-special" == $(this).attr("class")) {
                            if (index == 13) {
                                $(this).find("div").css("width","540px");
                            }else if (index == 14 || index == 22) {
                                $(this).find("div").css("width", "360px");
                            }else if (index == 6) {
                                $(this).find("div").css("width", "420px");
                            } else if (index == 9 || index == 26) {
                                $(this).find("div").css("width", "215px");
                            } else if (index == 21 || index == 24) {
                                $(this).find("div").css("width", "180px");
                            } else {
                                $(this).find("div").css("width", "120px");
                            }
                        }

                    });
                    $(".layui-table-header").find("tr").eq(4).find("th").find("div").css("width", "15px");
                    $(".layui-table-header").find("tr").eq(4).find("th").each(function (index, element) {
                        if (" layui-table-col-special" == $(this).attr("class")) {
                            $(this).find("div").css("width","120px")
                        }
                    });
                    $(".layui-table-header").find("tr").eq(5).find("th").find("div").css("width", "15px");
                    //设置单元格的边框
                    $(".layui-table-header").find("tr").eq(1).find("th").eq(0).attr('style','border-right:none');
                    if (localCode == '140000') {
                        $(".layui-table-header").find("tr").eq(2).find("th").eq(7).find("div").text("人户分离") ;
                    }
                    //处理角色不同，所看见的列也不同
                    if (level == 7) {
                        //地市司法局
                        $(".layui-table-header").find("tr").eq(6).find("th").each(function (index, element) {
                            if (index >3 && index < 6) {
                                $(this).addClass("layui-hide");
                            }
                        });
                        $(".layui-table-header").find("tr").eq(4).find("th").each(function (index, element) {
                            if (index >3 && index < 6) {
                                $(this).addClass("layui-hide");
                            }
                        });
                        $(".layui-table-header").find("tr").eq(3).find("th").each(function (index, element) {
                            if (index == 2) {
                                $(this).addClass("layui-hide");
                            }
                        });
                        $(".layui-table-header").find("tr").eq(3).find("th").eq(0).find("div").text("区县司法局") ;
                        $(".layui-table-header").find("tr").eq(3).find("th").eq(1).find("div").text("司法所") ;
                        $(".layui-table-header").find("tr").eq(2).find("th").each(function (index, element) {
                            if (index== 1) {
                                $(this).attr("colspan",6)
                            }
                        });
                        $(".layui-table-header").find("tr").eq(1).find("th").each(function (index, element) {
                            if (index== 1) {
                                $(this).attr("colspan",68)
                            }
                        });
                        $(".layui-table-body").find("td").each(function (index, element) {
                            if ($(this).attr("data-field") == 'cccjgs' ||$(this).attr("data-field") == 'cccjgrs') {
                                $(this).css("display", "none");
                            }
                        });
                    }else if (level == 8) {
                        //区县司法局
                        $(".layui-table-header").find("tr").eq(6).find("th").each(function (index, element) {
                            if (index >1 && index < 6) {
                                $(this).addClass("layui-hide");
                            }
                        });
                        $(".layui-table-header").find("tr").eq(4).find("th").each(function (index, element) {
                            if (index >1 && index < 6) {
                                $(this).addClass("layui-hide");
                            }
                        });
                        $(".layui-table-header").find("tr").eq(3).find("th").each(function (index, element) {
                            if (index== 1 || index == 2) {
                                $(this).addClass("layui-hide");
                            }
                        });
                        $(".layui-table-header").find("tr").eq(3).find("th").eq(0).find("div").text("司法所") ;
                        $(".layui-table-header").find("tr").eq(2).find("th").each(function (index, element) {
                            if (index== 1) {
                                $(this).attr("colspan",4)
                            }
                        });
                        $(".layui-table-header").find("tr").eq(1).find("th").each(function (index, element) {
                            if (index== 1) {
                                $(this).attr("colspan",66)
                            }
                        });
                        $(".layui-table-body").find("td").each(function (index, element) {
                            if ($(this).attr("data-field") == 'ccjgs' || $(this).attr("data-field") == 'ccjgrs' || $(this).attr("data-field") == 'cccjgs' ||$(this).attr("data-field") == 'cccjgrs') {
                                $(this).css("display", "none");
                            }
                        });
                    }
                    layer.close(loadingMsg);
                    //处理复杂表头固定
                    let headerTop = $('.layui-table-header').offset().top; //获取表格头到文档顶部的距离
                    $(window).scroll(function () {
                        if ((headerTop - $(window).scrollTop()) < 0) { //超过了
                            $('.layui-table-header').addClass('table-header-fixed'); //添加样式，固定住表头
                            $('.layui-table-box').addClass('table-height');
                        } else { //没超过
                            $('.layui-table-header').removeClass('table-header-fixed'); //移除样式
                            $('.layui-table-box').removeClass('table-height'); //移除样式
                        }
                    });
                    //滚动body,header跟随滚动
                    $('.layui-table-body').on('scroll', function(e) {
                        var leftPx = $(e.target).scrollLeft(); //获取表格body，滚动条距离左边的长度
                        var left = 'translateX(-' + leftPx + 'px)';
                        $('.layui-table-header .layui-table').css('transform', left); //设置表格header的内容反向(-)移动
                    });
                },
            });
        }

        $("#exports").click(function () {
            if (startDate == undefined || endDate == undefined) {
                startDate == year + '-01-01';
                endDate == new Date();
            }
            top.location.href = encodeURI("/azbj/statisticalreports/exportExcelFile?startDate="+startDate+"&endDate="+endDate+"");
            reloadTable();
        });
        $("#select").click(function () {
            reloadTable();
        });
    });

</script>

</body>
</html>